package com.aaa.set.controller.api;

import com.aaa.set.service.UpdateMemberPasswordService;
import com.aaa.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * @author 荆豪峰
 * @version 1.0
 * #Date: 2023/3/9 11:07
 */
@Api(value = "set/UpdateMemberPassword", tags = {"#Date: 2023/3/9 11:07"})
@RestController
@RequestMapping("set/UpdateMemberPassword")
public class UpdateMemberPasswordController {
    @Autowired
    private UpdateMemberPasswordService updateMemberPasswordService;
    /**
     * #Description 用户修改密码输入旧密码
     * @param OldPassword
     * @param request
     * @return com.aaa.vo.Result
     * @author 荆豪峰
     * #Date 2023/3/9
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "OldPassword", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "HttpServletRequest", name = "request", value = "", required = true)
    })
    @ApiOperation(value = "#Description 用户修改密码输入旧密码 #Date 2023/3/9", notes = "#Description 用户修改密码输入旧密码 #Date 2023/3/9", httpMethod = "POST")
    @PostMapping("getOldpswd")
    public Result getOldpswd(String OldPassword,HttpServletRequest request){
         return updateMemberPasswordService.findPassword(OldPassword,request);
    }
    /**
     * #Description 用户修改密码
     * @param password
     * @param request
     * @return com.aaa.vo.Result
     * @author 荆豪峰
     * #Date 2023/3/9
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "password", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "HttpServletRequest", name = "request", value = "", required = true)
    })
    @ApiOperation(value = "#Description 用户修改密码 #Date 2023/3/9", notes = "#Description 用户修改密码 #Date 2023/3/9", httpMethod = "POST")
    @PostMapping("UpdateMemberPassword")
    public Result UpdateMemberPassword(String password,HttpServletRequest request){
        return updateMemberPasswordService.UpdatePassword(password,request);
    }

}
